package com.julian.delegatePattern.gumballMachine.client;

import com.julian.delegatePattern.gumballMachine.GumballMachineRemote;

import java.rmi.RemoteException;

public class GumballMonitor {
    GumballMachineRemote gumballMachineRemote;

    public GumballMonitor(GumballMachineRemote gumballMachineRemote) {
        this.gumballMachineRemote = gumballMachineRemote;
    }

    public void report(){
        try{
            System.out.println("Gumball Machine: " + gumballMachineRemote.getLocation());
            System.out.println("Current inventory: " + gumballMachineRemote.getLocation());
            System.out.println("Current state: " + gumballMachineRemote.getState());
        }catch (RemoteException e){
            e.printStackTrace();
        }
    }
}
